﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="XacNhanDatHangaspx.aspx.cs" Inherits="XacNhanDatHangaspx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="ThemSP">
        <table id="HienThiTim">
           <tr valign="top">
               <td> <asp:Calendar ID="Calendar1" runat="server" BackColor="#FFFFCC" BorderColor="#FFCC66" BorderWidth="1px" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="#663399" Height="200px" OnSelectionChanged="Calendar1_SelectionChanged" ShowGridLines="True" Width="220px">
                   <DayHeaderStyle BackColor="#FFCC66" Font-Bold="True" Height="1px" />
                   <NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" />
                   <OtherMonthDayStyle ForeColor="#CC9966" />
                   <SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
                   <SelectorStyle BackColor="#FFCC66" />
                   <TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt" ForeColor="#FFFFCC" />
                   <TodayDayStyle BackColor="#FFCC66" ForeColor="White" />
                   </asp:Calendar>
               </td>
               <td style="width: 63px">
                 Ngày :
               </td>
               <td>
                   <asp:TextBox ID="txtNgay" runat="server" Width="98px"></asp:TextBox>

               </td>
               <td>
                  
                   <asp:Button ID="HienThi" runat="server" Text="Hiện Thị" CssClass="myButton" OnClick="HienThi_Click" />
            
               </td>
               <td> Khung Nhập Ngày Trống có nghĩa là Hiện Thị Tất Cả Các Đơn Hàng Chưa Duyệt</td>
           
           </tr>
        </table>
        <div id="hienThiDatHang" runat="server">
            <p>Thông Tin Đặt Hàng Ngày <asp:Label ID="Label1" runat="server" Text=" "></asp:Label> Chưa Xử Lý </p>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="MaGioHang" DataSourceID="AccessDataSource1">
                <Columns>
                    <asp:BoundField DataField="MaGioHang" HeaderText="Mã Đặt Hàng" InsertVisible="False" ReadOnly="True" SortExpression="MaGioHang" />
                    <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" />
                    <asp:BoundField DataField="NgayTao" HeaderText="Ngày " SortExpression="NgayTao" />
                    <asp:BoundField DataField="DiaChiGiao" HeaderText="Địa Chỉ Giao Hàng" SortExpression="DiaChiGiao" />
                    <asp:BoundField DataField="SODTGIAO" HeaderText="Số Điện Thoại" SortExpression="SODTGIAO" />
                    <asp:BoundField DataField="TongThanhTien" HeaderText="Tồng Thành Tiền" SortExpression="TongThanhTien" />
                    <asp:BoundField DataField="KiemTra" HeaderText="Tình Trạng" SortExpression="KiemTra" />
                    <asp:TemplateField HeaderText="Xem Chi Tiết">
                        <ItemTemplate>
                            <a href="XacNhanDatHangaspx.aspx?MaGioHang=<%# Eval("MaGioHang") %>&NgayTao=<%# Eval("NgayTao") %>">
                                <asp:Label ID="Label1" runat="server" Text="Click"></asp:Label></a>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Data.mdb" SelectCommand="SELECT MaGioHang, NgayTao, DiaChiGiao, SODTGIAO, KiemTra, TongThanhTien, ID FROM GioHang WHERE (NgayTao LIKE ?) AND (KiemTra = 'waiting')">
                <SelectParameters>
                    <asp:QueryStringParameter Name="NgayTao" QueryStringField="NgayTao" Type="String" />
              
                </SelectParameters>
            </asp:AccessDataSource>
        </div>
        <div id="chiTietDatHang" runat="server">
            <p> Thông Tin Chi Tiết Của Đơn Đặt Hàng <asp:Label ID="ThongBaoChiThiet" runat="server" Text=""></asp:Label></p>
            <asp:GridView ID="GridView2" runat="server" DataSourceID="AccessDataSource3" AutoGenerateColumns="False">
                <Columns>
                    <asp:BoundField DataField="TenSP" HeaderText="Tên Sản Phẩm " SortExpression="TenSP"></asp:BoundField>
                    <asp:BoundField DataField="Gia" HeaderText="Đơn Giá" SortExpression="Gia"></asp:BoundField>
                    <asp:BoundField DataField="SoLuongDat" HeaderText="Số Lượng" SortExpression="SoLuongDat"></asp:BoundField>
                    <asp:BoundField DataField="TongSoTien" HeaderText="Tổng Tiền" ReadOnly="True" SortExpression="TongSoTien"></asp:BoundField>
                </Columns>
            </asp:GridView>
            <asp:AccessDataSource runat="server" ID="AccessDataSource3" DataFile="~/App_Data/Data.mdb" SelectCommand="SELECT SanPham.TenSP, SanPham.Gia, ChiTietGioHang.SoLuongDat, SanPham.Gia * ChiTietGioHang.SoLuongDat AS TongSoTien FROM (ChiTietGioHang INNER JOIN SanPham ON ChiTietGioHang.MaSP = SanPham.MaSP) WHERE (ChiTietGioHang.MaGioHang = ?) GROUP BY SanPham.TenSP, SanPham.Gia, ChiTietGioHang.SoLuongDat">
                <SelectParameters>
                    <asp:QueryStringParameter QueryStringField="MaGioHang" Name="?"></asp:QueryStringParameter>
                </SelectParameters>
            </asp:AccessDataSource>
            Kiểm TRa : <asp:CheckBox ID="KiemTra" runat="server" />
            &nbsp;&nbsp;&nbsp;
            Tình Trạng<asp:DropDownList ID="DropDownList1" runat="server">
                <asp:ListItem Value="Chon">Chọn</asp:ListItem>
                <asp:ListItem Value="completed">Completed</asp:ListItem>
                <asp:ListItem Value="waiting">Waiting</asp:ListItem>
                <asp:ListItem Value="canceled">Canceled</asp:ListItem>
            </asp:DropDownList>
            <br />
            <asp:Button ID="BtnXacNhan" runat="server" Text="Xác Nhận" CssClass="myButton" OnClick="BtnXacNhan_Click" />
            <asp:Label ID="ThongBao" runat="server" Text=" "></asp:Label>
        </div>
    </div>
</asp:Content>

